import java.io.PipedOutputStream;

//向管道输出流写数据的线程
class Sender extends Thread{
    private PipedOutputStream out=new PipedOutputStream();
    public PipedOutputStream getPipedOutputStream(){
        return out;
    }


    @Override
    public void run() {
        String s="WELCOME TO PIPEDOUTPUTSTREAM ";
        try{
            out.write(s.getBytes());
            out.close();
        }catch (Exception E){
            throw new RuntimeException(E);
        }
    }
}
